﻿using System;

namespace Model
{
    public class PlcAddr : ModelBase
    {
        private int _ID;
        private string _NO = "";
        private string _Name = "";
        private string _Address = "";
        private string _Note = "";
        private int _plcID;
        private Plc _Plc;
        private int _AddrValue;
        private DateTime _dateTimeSpan = DateTime.Now;
        private bool _enable = true;
        private bool _isPara;
        private string _addrtype;
 
        public int ID { get => _ID; set => Set(ref _ID, value); }


        /// <summary>
        /// 编号
        /// </summary>
        public string No { get => _NO; set => Set(ref _NO, value); }

        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get => _Name; set => Set(ref _Name, value); }

        /// <summary>
        /// 地址
        /// </summary>
        public string Address { get => _Address; set => Set(ref _Address, value); }

        /// <summary>
        /// 备注
        /// </summary>
        public string Note { get => _Note; set => Set(ref _Note, value); }

        /// <summary>
        /// 地址读取值
        /// </summary>
        public int AddrValue { get => _AddrValue; set => Set(ref _AddrValue, value); }

        /// <summary>
        /// 对应PLC
        /// </summary>
        public Plc Plc { get => _Plc; set => Set(ref _Plc, value); }

        /// <summary>
        /// 对应PLC的ID
        /// </summary>
        public int PlcID { get => _plcID; set => Set(ref _plcID, value); }
        /// <summary>
        /// 建立时间
        /// </summary>
        public DateTime TimeStamp { get => _dateTimeSpan; set => Set(ref _dateTimeSpan, value); }
        /// <summary>
        /// 是否是参数，是参数不参与轮询，不是参数，参与轮询
        /// </summary>
        public bool IsPara
        {
            get => _isPara;
            set => Set(ref _isPara, value);
        }

        /// <summary>
        /// 是否启用
        /// </summary>
        public bool Enable
        {
            get => _enable;
            set => Set(ref _enable, value);
        }

        public string AddrType
        {
            get => _addrtype;
            set => Set(ref _addrtype, value);
        }
    }
}
